//
// Created by liushuai on 18-10-30.
//

#include "Line.h"
#include "Point.h"
#include "iostream"
Line::Line(int x1, int y1, int x2, int y2){
    start = new Point(x1,y1);
    end = new Point(x2,y2);
};
Line::~Line() {
    delete start;
    delete end;
    std::cout<<"Destroy Line"<<"\n";
}
void Line::Show_info() {
    std::cout<<"Show_info"<<"\n";
    std::cout<<"start point:"<<start->getX()<<","<<start->getY()<<"\n";
    std::cout<<"end point:"<<end->getX()<<","<<end->getY()<<"\n";
}
//常成员函数和普通成员函数互为重载
void Line::Show_info() const {
    std::cout<<"Show_info const"<<"\n";
    std::cout<<"start point:"<<start->getX()<<","<<start->getY()<<"\n";
    std::cout<<"end point:"<<end->getX()<<","<<end->getY()<<"\n";
}